//
//  ExtractedFunctionsBoot.swift
//  SwiftUIWidgetDemo
//
//  Created by alanzhangg on 2023/7/12.
//

import SwiftUI

struct ExtractedFunctionsBoot: View {
    
    @State var backgroundColor: Color = .pink
    
    var body: some View {
        ZStack{
            backgroundColor.ignoresSafeArea()
            
            contenLayer
        }
    }
    
    var contenLayer: some View{
        VStack{
            Text("title")
                .font(.largeTitle)
                
            Button(action: {
                buttonPress()
            }, label: {
                Text("Press me")
                    .font(.headline)
                    .foregroundStyle(.white)
                    .padding()
                    .background(.black)
                    .cornerRadius(10)
            })
        }
    }
    
    func buttonPress() {
        backgroundColor = .yellow
    }
    
}

#Preview {
    ExtractedFunctionsBoot()
}
